<?php
@session_start();
date_default_timezone_set('UTC');
$selfpagearr=explode("/",$_SERVER["PHP_SELF"]);
$pagename=$selfpagearr[count($selfpagearr)-1];
if(!strstr($pagename,".php"))
{
    $pagename="index.php";
}
extract($_POST);

require_once "lib/config.php";
require_once "lib/functions.php";
require_once "lib/pdomanager.php";
require_once "lib/paginate_class.php";

getProjectRootPath();

$pdodbobj=new DB();
$pdodbobj->dbname=DBNAME;
$pdodbobj->hostname=HOST;
$pdodbobj->dbusername=USERNAME;
$pdodbobj->dbpassword=PASSWORD;
$pdodbobj->dbtype=TYPE;
$pdodbobj->portnumber=PORTNUMBER;


$loggedinuserdetails=array();

if(isset($_SESSION['Allyfolio_User_ID']) && $_SESSION['Allyfolio_User_ID']>0)
{
    $userdetailsqry="select * from af_users where User_ID=:userid";
    $loggedinuserdetails=$pdodbobj->fetch_array($pdodbobj->query($userdetailsqry,array(":userid"=>$_SESSION['Allyfolio_User_ID'])));
    
    if(isset($loggedinuserdetails) && count($loggedinuserdetails)>0){
        if($loggedinuserdetails[0]["Profile_Status"]==3 || $loggedinuserdetails[0]["Profile_Status"]==-1){
            $_SESSION['Allyfolio_User_ID']=-1;
            $_SESSION['UserStatus']="account_is_removed";
            
        }
    }    
}

?>